import layoutHeaderAside from '@/layout/header-aside'

// 由于懒加载页面太多的话会造成webpack热更新太慢，所以开发环境不使用懒加载，只有生产环境使用懒加载
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)

const meta = { auth: true }

export default {
    path: '/marketing',
    name: 'marketing',
    meta,
    redirect: { name: 'marketing' },
    component: layoutHeaderAside,
    children: (pre => [
		{
		    path: 'recommendList',
		    name: `${pre}recommendList`,
		    component: _import('marketing/recommendList'),
		    meta: {
		        ...meta,
		        title: '推荐商品管理'
		    }
		},
		{
		    path: 'purchaseLimitList',
		    name: `${pre}purchaseLimitList`,
		    component: _import('marketing/purchaseLimitList'),
		    meta: {
		        ...meta,
		        title: '限购商品管理'
		    }
		},
		{
		    path: 'displayWindowList',
		    name: `${pre}displayWindowList`,
		    component: _import('marketing/displayWindowList'),
		    meta: {
		        ...meta,
		        title: '商品橱窗管理'
		    }
		},
		{
		    path: 'specialPageList',
		    name: `${pre}specialPageList`,
		    component: _import('marketing/specialPageList'),
		    meta: {
		        ...meta,
		        title: '专题页面管理'
		    }
		},
		{
		    path: 'couponBonusRuleList',
		    name: `${pre}couponBonusRuleList`,
		    component: _import('marketing/couponBonusRuleList'),
		    meta: {
		        ...meta,
		        title: '消费券赠送规则'
		    }
		},
		{
		    path: 'communityRanking',
		    name: `${pre}communityRanking`,
		    component: _import('marketing/communityRanking'),
		    meta: {
		        ...meta,
		        title: '社区公益排行'
		    }
		},
    ])('marketing-')
}
